package by.ostrovsky.webhousingsystem.hibernate.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

import by.ostrovsky.webhousingsystem.hibernate.entity.common.Common;

@Entity
@Table(name = "requestedwork")
public class UserRequest extends Common<Long>{
	@Id @GeneratedValue(generator="increment")
	@GenericGenerator(name="increment", strategy = "increment") 
	@Column(name = "REQUESTEDWORK_ID")
	private Long id;
	@Column(name = "REQUESTEDWORK_WORK")
	private String work;
	@Column(name = "REQUESTEDWORK_DEADLINE")
	@Temporal(value = TemporalType.DATE)
	private Date deadline;
	@Column(name = "REQUESTEDWORK_PHONE")
	private String phone;
	@Column(name = "REQUESTEDWORK_ADDINFO")
	private String addinfo;
	@OneToOne
	@JoinColumn(name = "ACCOUNT_LOGIN")
	private Account account;
	@Column(name = "REQUESTEDWORK_REGDATE")
	@Temporal(value = TemporalType.DATE)
	private Date regdate;
	@Column(name = "REQUESTEDWORK_ISACCEPTED")
	private Boolean accepted;
	
	public Boolean getAccepted() {
		return accepted;
	}

	public void setAccepted(Boolean accepted) {
		this.accepted = accepted;
	}

	public Date getRegdate() {
		return regdate;
	}

	public void setRegdate(Date regdate) {
		this.regdate = regdate;
	}

	public UserRequest() {}

	@Override
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getWork() {
		return work;
	}

	public void setWork(String work) {
		this.work = work;
	}

	public Date getDeadline() {
		return deadline;
	}

	public void setDeadline(Date deadline) {
		this.deadline = deadline;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getAddinfo() {
		return addinfo;
	}

	public void setAddinfo(String addinfo) {
		this.addinfo = addinfo;
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}
}
